package com.sailing.xjpb.common.orika;

import com.sailing.xjpb.common.TypeUtils;
import ma.glasnost.orika.CustomConverter;
import ma.glasnost.orika.MappingContext;
import ma.glasnost.orika.metadata.Type;

/**
 * 解决String to Number
 *
 * @author YaoWei
 */
public class StringToLong extends CustomConverter<String, Long> {

    @Override
    public Long convert(String s, Type<? extends Long> type, MappingContext mappingContext) {
        return TypeUtils.toNumber(s, Long.class);
    }
}